package lzc.encrypt;

import com.github.davidmoten.rtree.geometry.Rectangle;
import lzc.encrypt.encryption.BigIntMatrix;
import lzc.encrypt.encryption.DataVector;
import lzc.encrypt.encryption.Parameter;
import lzc.encrypt.encryption.SearchVector;
import lzc.encrypt.rtree.ERTree;

import java.math.BigInteger;

public class IPPE {
    /**
     * 预设置用于生成随机整数矩阵的参数
     *
     * @param limit_matrix    0-1 矩阵数量的取值范围（第0个值应小于第1个值，且第0个值不小于0）
     * @param limit_calculate 计算随机整数矩阵的互乘次数的取值范围（第0个值应小于第1个值，且第0个值不小于0）
     */
    public static void preSetup(int[] limit_matrix, int[] limit_calculate, double fpp) {
        if (limit_matrix[0] > limit_matrix[1] || limit_calculate[0] > limit_calculate[1] || limit_matrix[0] < 0 || limit_calculate[0] < 0) {
            throw new IllegalArgumentException("取值范围不存在");
        }

        BigIntMatrix.limit_matrix = limit_matrix;
        BigIntMatrix.limit_calculate = limit_calculate;
        Parameter.fpp = fpp;
    }
}
